USE [JaxDug]
GO

IF OBJECT_ID('spListAllBooks') IS NOT NULL
BEGIN
    DROP PROCEDURE spListUsersByEmailAndPortalId
    PRINT 'Dropping Procedure spListAllBooks'
END
GO
Print 'Creating Procedure spListAllBooks'
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].spListAllBooks
AS /***************************************
** Name:            spListAllBooks
** Creation Date:   March 15, 2012
** Author:          Tony Rose
** Comments:        List all books in the database
**
** History:         [DATE] - [TICKET] - [Description of Change]
**************************************/
BEGIN TRY
    SET NOCOUNT ON ;
    SELECT *
    FROM [JaxDug].[dbo].[Book]
END TRY
BEGIN CATCH
    DECLARE
    @ErrorSeverity INT,
    @ErrorMessage varchar(max) ;
    SELECT @ErrorSeverity = ERROR_SEVERITY(),
           @ErrorMessage = '[spListAllBooks] Errored: ' +
                            ERROR_MESSAGE()
    RAISERROR (@ErrorMessage , @ErrorSeverity , 1) WITH LOG
END CATCH ;
GO